﻿<UserControl x:Class="EX_NFC.FrontEnd.Windows.Controls.TagAuthenticateControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
             xmlns:Converters="clr-namespace:EX_NFC.FrontEnd.Windows.Converters"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300">
    <UserControl.Resources>
        <Converters:OppositeBoolConverter x:Key="OppositeBoolConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"  />
        </Grid.RowDefinitions>
        <extToolkit:WatermarkTextBox Grid.Column="0"
                                     Watermark="{Binding Source={StaticResource Localizer},Path=Localize.TagAuthentication_StringKey}"
                                     Text="{Binding Key,UpdateSourceTrigger=PropertyChanged}" Width="150" VerticalAlignment="Center"/>
        <TextBlock Text="{Binding Source={StaticResource Localizer},Path=Localize.TagInfo_TagType}"
                   Grid.Column="1"
                   Style="{DynamicResource ContentTextStyle}"
                   VerticalAlignment="Center"
                   Margin="{DynamicResource BasicMargin}" />
        <RadioButton Grid.Column="2"
                     IsChecked="{Binding ByteKey}"
                     Content="{Binding Source={StaticResource Localizer},Path=Localize.TagAuthentication_Byte}"
                     Margin="{DynamicResource BasicMargin}" />
        <RadioButton Grid.Column="3"
                     IsChecked="{Binding ByteKey,Converter={StaticResource OppositeBoolConverter}}"
                     Content="{Binding Source={StaticResource Localizer},Path=Localize.TagAuthentication_String}"
                     Margin="{DynamicResource BasicMargin}" />
        <TextBlock Text="{Binding Source={StaticResource Localizer},Path=Localize.TagAuthentication_SectorNumber}"
                   Grid.Column="4"
                   Style="{DynamicResource ContentTextStyle}"
                   VerticalAlignment="Center" />
        <ComboBox ItemsSource="{Binding SectorList}"
                  Grid.Column="5"
                  SelectedIndex="{Binding SelectedSector,Mode=TwoWay}"
                  Margin="{DynamicResource BasicMargin}"
                  Width="{DynamicResource MediumControlWidth}"
                  Height="30" />
        <TextBlock Text="{Binding Source={StaticResource Localizer},Path=Localize.TagAuthentication_BlockNumber}"
                   Style="{DynamicResource ContentTextStyle}"
                   Grid.Column="6"
                   VerticalAlignment="Center" />
        <ComboBox ItemsSource="{Binding SectorList}"
                  Grid.Column="7"
                  SelectedIndex="{Binding SelectedBlock,Mode=TwoWay}"
                  Margin="{DynamicResource BasicMargin}"
                  Width="{DynamicResource MediumControlWidth}"
                  Height="30" />
        <Button Content="{Binding Source={StaticResource Localizer},Path=Localize.TagAuthentication_Authenticate}"
                Grid.Column="8"
                Command="{Binding CommandAuthenticate}"
                Margin="{DynamicResource BasicMargin}"
                Width="{DynamicResource MediumControlWidth}"
                Height="{DynamicResource MediumControlHeight}" />
    </Grid>
</UserControl>
